package com.xl.optimize.second;

abstract class Beverage {
    public final void prepareBeverage() {
        boilWater();
        brew();
        pourInCup();
        addCondiments();
    }
    private void boilWater() {
         System.out.println("Boiling  water");
    }
    abstract void brew();
    private void pourInCup() {
        System.out.println("Pouring  into  cup");
    }
    abstract void addCondiments();
}

class Coffee1 extends Beverage  {
    @Override
    void brew() {
        System.out.println("Brewing  coffee  grinds");
    }
    @Override
    void addCondiments() {
        System.out.println("Adding  sugar  and  milk");
    }
}

class Tea1 extends Beverage  {
    @Override
    void brew() {
        System.out.println("Steeping  the  tea  bag");
    }

    @Override
    void addCondiments() {
        System.out.println("Adding  lemon");
    }
}